/*
 * @Author: minglic minglic@foxmail.com
 * @Date: 2023-11-04 16:00:47
 * @LastEditors: minglic minglic@foxmail.com
 * @LastEditTime: 2023-11-04 16:03:52
 * @FilePath: \go2023\core\utils\json.go
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package utils

import (
	"encoding/json"
	"fmt"
)

func ToJson(data any) string {
	byte, err := json.Marshal(data)
	if err != nil {
		fmt.Println("转json出错:", err)
		return ""
	}

	return string(byte)
}
